package com.drakulo.hi.logic.actions;

import com.dk.hi.core.Team;
import com.dk.hi.core.exceptions.HIException;

/**
 * <b>Action on Money</b>
 * <p>
 * this action modify the team's money
 * </p>
 */
public class MoneyAction implements Action {
	/**
	 * Value
	 */
	private int delta;

	/**
	 * Constructor
	 * 
	 * @param delta
	 *            - delta d'argent à appliquer sur la bourse des héros
	 */
	public MoneyAction(Integer delta) {
		this.delta = delta;
	}

	@Override
	public void run() throws HIException {
		if (this.delta > 0) {
			Team.addMoney(this.delta);
		} else {
			Team.removeMoney(this.delta);
		}
	}

}
